const fs = require('fs')
const {
    getUrlAndNameMore
} = require('./getUrlAndNameMore')
const {
    getUrlAndNameSingle
} = require('./getUrlAndNameSingle')

const singerF = {
        hasPage: false,
        id: "S0009",
        url: "http://www.51ape.com/skin/ape/php/qx_2.php?qx=Adele",
        singer: "Adele"
    },
    singerT = {
        hasPage: true,
        id: "S0243",
        url: "http://www.51ape.com/gem/",
        singer: "邓紫棋",
    },
    missingSinger = {
        url: "http://www.51ape.com/skin/ape/php/qx_2.php?qx=Sinéad+O'Connor",
        singer: "Sinéad O'Connor",
        hasPage: false,
        id: 'S0893'
    }

if (missingSinger.hasPage) {
    getUrlAndNameMore(missingSinger.url, missingSinger.singer, missingSinger.id)
} else {
    getUrlAndNameSingle(missingSinger.url, missingSinger.singer, missingSinger.id)
}

// if (singerT.hasPage) {
//     getUrlAndNameMore(singer.url, singer.value, singer.id)
// }
// if (!singerF.hasPage) {
//     getUrlAndNameSingle(singerF.url, singerF.singer, singerF.id)
// }